<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@page import="java.util.Date"%>
<%
String path = request.getContextPath();
String basePath =request.getScheme()+"://"+request.getServerName()+":"
+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>问题</title>
<base href="<%=basePath%>">
<link href="bootstrap/css/bootstrap.css" rel="stylesheet">
<script src="bootstrap/js/jquery-1.12.4.js"></script>
<script src="bootstrap/js/bootstrap.js"></script>
<script src="js/date.js"></script>
<link rel='stylesheet' id='reset-css'  href='css/reset.css' type='text/css' media='all' />
<link rel='stylesheet' id='superfish-css'  href='css/superfish.css' type='text/css' media='all' />
<link rel='stylesheet' id='fontawsome-css'  href='css/font-awsome/css/font-awesome.css' type='text/css' media='all' />
<link rel='stylesheet' id='orbit-css-css'  href='css/orbit.css' type='text/css' media='all' />
<link rel='stylesheet' id='style-css'  href='css/style.css' type='text/css' media='all' />
<link rel='stylesheet' id='color-scheme-css'  href='css/color/green.css' type='text/css' media='all' />
<link rel="stylesheet" href="css/zerogrid.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/responsive.css" type="text/css" media="screen">
<script type='text/javascript' src='js/jquery.js'></script>
<script type='text/javascript' src='js/jquery-migrate.min.js'></script>
<script type='text/javascript' src='js/jquery-1.10.2.min.js'></script>
<script type='text/javascript' src='js/jquery.carouFredSel-6.2.1-packed.js'></script>
<script type='text/javascript' src='js/hoverIntent.js'></script>
<script type='text/javascript' src='js/superfish.js'></script>
<script type='text/javascript' src='js/orbit.min.js'></script>
 <script src="js/css3-mediaqueries.js"></script>

<script type="text/javascript" language="javascript">
	$(function() {
		
		/* Start Carousel */
		$('#featured-posts').carouFredSel({
			auto: true,
					prev: '#prev2',
					next: '#next2',
		});
		/* End Carousel */
		
		
		/* Start Orbit Slider */
		$(window).load(function() {
			$('.post-gallery').orbit({
				animation: 'fade',
			});
		});
		/* End Orbit Slider */
			
			
		/* Start Super fish */
		jQuery(document).ready(function(){
			jQuery('ul.sf-menu').superfish({
				delay:         100,
				speed:         'fast',
				speedOut:      'fast',
			});
		});
		/* End Of Super fish */
			
	});
</script>
<script type="text/javascript">
function baocun(){
	var obj = new Object();
	obj.quesTitle=$("#title").val();
	obj.quesDesc=$("#desc").val();
	if(!obj.quesTitle.trim()){
		alert("标题不能为空");
		return false;
	}
	
	if(!/[\w\W]{5,}/.test(obj.quesTitle)){
		alert("标题不能少于五个字");
		return false;
	}
	
	$.post("<%=basePath%>Question2/insertQuestion2",obj,function(result){
		var question=result.data.question;
		var userInfo=result.data.userInfo;
		var date = format(question.qUpdateTime);
		$("#qId").append(question.qId);
		$("#user").append('<img src="../'+userInfo.uPhoto+'" width="70px" height="70px"/>'+userInfo.uName+'<br>');
		$("#quest").append('<h3>'+question.quesTitle+'</h3>'+'<br>'+date+'<br>'+question.quesDesc);
	}, 'json');
}
function answer(){
	var obj = new Object();
	obj.qId=$("#qId").text();
	obj.quesAnswer=$("#answer").val();
	obj.pageNumber=1;
	if(!obj.quesAnswer.trim()){
		alert("标题不能为空");
		return false;
	}
	
	$.post("<%=basePath%>Answer2/insertAnswer2",obj,function(result){
		var Answerlist=result.data.answersByPage;
		var userInfolist=result.data.userInfolist;
		$.each(Answerlist,function(idx,obj){
			var date = format(obj.aUpdateTime);
			$("#time").append(date);
			$("#answers").append(obj.quesAnswer);
		});
		$.each(userInfolist,function(idx,obj){
			$("#userimg").attr("src","../"+obj.uPhoto);
			$("#username").append(obj.uName);
		});
	}, 'json');
}
</script>
</head>

   <body class="home blog">

	<!-- Start Header -->
    <div class="container zerogrid">
        <div class="col-full"><div class="wrap-col">
        	<div id="header-nav-container">
            
                    <a href="#">
                    <img src="images/logo.png" id="logo" />
                    </a>
                    
					<!-- Navigation Menu -->
                    
	<ul class="sf-menu"><li class="menu-item current-menu-item"><a href="index.html">主页</a></li>
		<li class="menu-item"><a href="#">登录</a>
<ul class="sub-menu">
	<li class="menu-item"><a href="#">个人资料</a></li>
	<li class="menu-item"><a href="#">退出</a></li>
</ul>
</li>
	<li class="menu-item"><a href="javascript:void(0)" data-toggle="modal" data-target="#myModal">
  提问
</a></li>

<li class="menu-item"><a href="complain.html">申诉</a></li>
</ul>	

<!-- Modal模态框 -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">问题</h4>
      </div>
      <div class="modal-body">
        	标题<br>
        	<input type="text" name="title" id="title"><span></span><br>
        	描述(可选)<br>
        	<input type="text" name="desc" id="desc"><br>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <input type="button" class="btn btn-primary" onclick="baocun()" data-dismiss="modal" value="提交"/>
      </div>
    </div>
  </div>
</div>   <!-- 模态框 -->
<!-- Modal模态框 -->
<div class="modal fade" id="answerModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel2">回答</h4>
      </div>
      <div class="modal-body">
        	回答<br>
        	<input type="text" name="answer" id="answer"><br>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <input type="button" class="btn btn-primary" onclick="answer()" data-dismiss="modal" value="回答"/>
      </div>
    </div>
  </div>
</div>   <!-- 模态框 -->
                    <!-- End Navigation Menu -->
                  <div class="widget-container">
                  <div>
                  <span id="qId" hidden></span>
                 <span align="center" id="quest"></span>
                 <span id="user" align="right"></span><br>
                  </div>
                 <a href="javascript:void(0)" name="submit"  id="comment-submit" data-toggle="modal" data-target="#answerModal" align="left" > 我也来回答</a>
                  </div>  
                    <div class="clear"></div>
                    
            </div>
			</div>
        </div>
    <div class="clear"></div> 
    </div>
    <div class="spacing-30"></div>
    <!-- End Header -->
	

    
    	
    
    <!-- Start Main Container -->
    <div class="container zerogrid">
    
        <!-- Start Posts Container -->
        <div class="col-2-3" id="post-container">
 			<div class="wrap-col">
                 
        	<!-- Start Post Item -->
            <div class="post">
            	<div class="post-margin">
                
                <div class="post-avatar">
                    <div class="avatar-frame"></div>
                    <img alt='' src='' id="userimg" class='avatar avatar-70 photo' height='70' width='70' />   </div>
                
                <h4 class="post-title"><a href="#" id="username"></a></h4>
                	<ul class="post-status">
                    <li><i class="fa fa-clock-o"></i><span id="time"></span></li>
                      <!--
                    	作者：595850161@qq.com
                    	时间：2017-11-17
                    	描述：<li><i class="fa fa-star "></i><a href="#" title="View all posts in Illustration" rel="category">取消收藏</a></li>
                    -->
                    
                    <li><i class="fa fa-star-o "></i><a href="#" title="View all posts in Illustration" rel="category">收藏</a></li>
                    <li><i class="fa fa-ban "></i><a href="report.html" title="View all posts in Illustration" rel="category">举报</a></li>
                    </ul>
                    <div class="clear"></div>
                </div>
            
            <div class="post-margin">
            <p id="answers"></p>
            </div>
            
             <ul class="post-social">
             <li><a href="#" target="_blank">
             <i class="fa fa-caret-square-o-up"> 0赞</i></a>
             </li>
                        
             <li>
             <a href="#" target="_blank">
             <i class="fa fa-caret-square-o-down"> 0踩</i></a>
             </li>
                        
            
            <li><script type="text/javascript">
			(function() {
				var p = {
					url: location.href,
					/*获取URL，可加上来自分享到QQ标识，方便统计*/
					desc: '',
					/*分享理由(风格应模拟用户对话),支持多分享语随机展现（使用|分隔）*/
					title: '',
					/*分享标题(可选)*/
					summary: '',
					/*分享摘要(可选)*/
					pics: '',
					/*分享图片(可选)*/
					flash: '',
					/*视频地址(可选)*/
					site: '',
					/*分享来源(可选) 如：QQ分享*/
					style: '201',
					width: 32,
					height: 32
				};
				var s = [];
				for(var i in p) {
					s.push(i + '=' + encodeURIComponent(p[i] || ''));
				}
				document.write(['<a class="" href="http://connect.qq.com/widget/shareqq/index.html?', s.join('&'), '" target="_blank"><i class="fa fa-plane"> 分享</i></a>'].join(''));
			})();
		</script>
            
            </li>
            
             <li>
             <a href="#" target="_blank">
             <i class="fa fa-comment-o"> Xx评论</i></a>
             </li>
            
            <li>
            <a href="answer.html" class="readmore">阅读全文 <i class="fa fa-arrow-circle-o-right"></i></a>
            </li>
            </ul>
            
            <div class="clear"></div>
            </div>
            <!-- End Post Item -->
            
                 
        	<!-- Start Post Item -->
            <div class="post">
            	<div class="post-margin">
                
                <div class="post-avatar">
                    <div class="avatar-frame"></div>
                    <img alt='' src='images/1.jpg' class='avatar avatar-70 photo' height='70' width='70' />                </div>
                
                <h4 class="post-title"><a href="#">One More Beer</a></h4>
                	<ul class="post-status">
                    <li><i class="fa fa-clock-o"></i>December 13, 2013</li>
                    <li><i class="fa fa-folder-open-o"></i><a href="#" title="View all posts in Illustration" rel="category">Illustration</a></li>
                    <li><i class="fa fa-comment-o"></i>No Comments</li>
                    </ul>
                    <div class="clear"></div>
                </div>
                
            		                    <div class="featured-image">
                    <iframe src="//player.vimeo.com/video/50522981?title=0&amp;byline=0&amp;portrait=0&amp;color=2ecc71" width="450" height="244" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>                    
                    <div class="post-icon">
                    <span class="fa-stack fa-lg">
                      <i class="fa fa-circle fa-stack-2x"></i>
                      <i class="fa fa-play-circle-o fa-stack-1x fa-inverse"></i>
                    </span>
                    </div>
                    </div>
                                
            <div class="post-margin">
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sit amet auctor ligula. Donec eu placerat lacus, pellentesque tincidunt felis. Aliquam dictum cursus elit, et sagittis nibh tincidunt quis. Vestibulum leo dui, ullamcorper quis erat nec, accumsan imperdiet ligula. Maecenas ut dui sed arcu sodales consequat. Nulla et est ac lacus congue volutpat. Aliquam vehicula tincidunt sem eget cursus. Nam sed mollis diam. Pellentesque id felis ut diam dignissim egestas id non ipsum.

Ut id magna eu eros vehicula sollicitudin at et odio. Mauris consectetur tortor in mauris aliquet feugiat. Etiam</p>
            </div>
            
             <ul class="post-social">
             <li><a href="#" target="_blank">
             <i class="fa fa-facebook"></i></a>
             </li>
                        
             <li>
             <a href="#" target="_blank">
             <i class="fa fa-twitter"></i></a>
             </li>
                        
             <li>
             <a href="#" target="_blank">
             <i class="fa fa-google-plus"></i></a>
             </li>
            
            <li>
            <a href="#" target="_blank">
            <i class="fa fa-linkedin"></i></a>
            </li>
            
            <li>
            <a href="#" class="readmore">Read More <i class="fa fa-arrow-circle-o-right"></i></a>
            </li>
            </ul>
            
            <div class="clear"></div>
            </div>
            <!-- End Post Item -->
            
                 
        	<!-- Start Post Item -->
            <div class="post">
            	<div class="post-margin">
                
                <div class="post-avatar">
                    <div class="avatar-frame"></div>
                    <img alt='' src='images/1.jpg' class='avatar avatar-70 photo' height='70' width='70' />                </div>
                
                <h4 class="post-title"><a href="#">Port Harbor</a></h4>
                	<ul class="post-status">
                    <li><i class="fa fa-clock-o"></i>December 13, 2013</li>
                    <li><i class="fa fa-folder-open-o"></i><a href="#" title="View all posts in Illustration" rel="category">Illustration</a></li>
                    <li><i class="fa fa-comment-o"></i>No Comments</li>
                    </ul>
                    <div class="clear"></div>
                </div>
                
            		                    <div class="featured-image">
                    <img src="img/Port_Harbor1-610x350.jpg" class="attachment-post-standard "  />                    
                    <div class="post-icon">
                    <span class="fa-stack fa-lg">
                      <i class="fa fa-circle fa-stack-2x"></i>
                      <i class="fa fa-pencil fa-stack-1x fa-inverse"></i>
                    </span>
                    </div>
                    </div>
                                
            <div class="post-margin">
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sit amet auctor ligula. Donec eu placerat lacus, pellentesque tincidunt felis. Aliquam dictum cursus elit, et sagittis nibh tincidunt quis. Vestibulum leo dui, ullamcorper quis erat nec, accumsan imperdiet ligula. Maecenas ut dui sed arcu sodales consequat. Nulla et est ac lacus congue volutpat. Aliquam vehicula tincidunt sem eget cursus. Nam sed mollis diam. Pellentesque id felis ut diam dignissim egestas id non ipsum.

Ut id magna eu eros vehicula sollicitudin at et odio. Mauris consectetur tortor in mauris aliquet feugiat. Etiam</p>
            </div>
            
             <ul class="post-social">
             <li><a href="#" target="_blank">
             <i class="fa fa-facebook"></i></a>
             </li>
                        
             <li>
             <a href="#" target="_blank">
             <i class="fa fa-twitter"></i></a>
             </li>
                        
             <li>
             <a href="#" target="_blank">
             <i class="fa fa-google-plus"></i></a>
             </li>
            
            <li>
            <a href="#" target="_blank">
            <i class="fa fa-linkedin"></i></a>
            </li>
            
            <li>
            <a href="#" class="readmore">Read More <i class="fa fa-arrow-circle-o-right"></i></a>
            </li>
            </ul>
            
            <div class="clear"></div>
            </div>
            <!-- End Post Item -->
            
                        
        <!-- Start Pagination -->
            <div class="spacing-20"></div><ul class="pagination"><li class='current'><a href=''>1</a></li><li><a href='http://www.freemoban.com/?euclid/?paged=2'>2</a></li><li><a href='http://www.freemoban.com/?euclid/?paged=3'>3</a></li><li><a href='http://www.freemoban.com/?euclid/?paged=4'>4</a></li></ul>
        <!-- End Pagination -->
            
        <div class="clear"></div>
		</div>
        </div>
        <!-- End Posts Container -->
		
        <!-- Start Sidebar -->
    	<div class="col-1-3">
		<div class="wrap-col">
			<div class="widget-container"><form role="search" method="get" id="searchform" class="searchform" action="#">
				<div>
					<label class="screen-reader-text" for="s"></label>
					<input type="text" value="" name="s" id="s" />
					<input type="submit" id="searchsubmit" value="搜索问题" />
				</div>
			</form><div class="clear"></div></div>
	    	<div class="widget-container"><h6 class="widget-title">目录</h6>		<ul>
	<li class="cat-item cat-item-5"><a href="myQuestion.html" title="View all posts filed under Apps">我的提问</a>
</li>
	<li class="cat-item cat-item-3"><a href="myCollection.html" title="View all posts filed under Illustration">我的收藏</a>
</li>
	<li class="cat-item cat-item-4"><a href="myAnswer.html" title="View all posts filed under Logo">我的回答</a>
</li>
		</ul>
<div class="clear"></div></div><div class="widget-container"><h6 class="widget-title">优秀回答</h6>	<!-- Start Widget -->
                <ul class="widget-recent-posts">
                                
                <li>
                <div class="post-image">
                <div class="post-mask"></div>
                <img width="70" height="70" src="img/HighRes-70x70.jpg" class="attachment-post-widget #"  />                </div>
                
                <h6><a href="#">张三</a></h6>
                <span>6个回答</span>
                <div class="clear"></div>
                </li> 
                
                                
                <li>
                <div class="post-image">
                <div class="post-mask"></div>
                <img width="70" height="70" src="img/one-more-beer-70x70.png" class="attachment-post-widget #"  />                </div>
                
                <h6><a href="#">李四</a></h6>
                <span>120个回答</span>
                <div class="clear"></div>
                </li> 
                
                                
                <li>
                <div class="post-image">
                <div class="post-mask"></div>
                <img width="70" height="70" src="img/Port_Harbor1-70x70.jpg" class="attachment-post-widget #"  />                </div>
                
                <h6><a href="#">麻子</a></h6>
                <span>9回答</span>
                <div class="clear"></div>
                </li> 
                
                                
                <li>
                <div class="post-image">
                <div class="post-mask"></div>
                <img width="70" height="70" src="img/Timothy-J-Reynolds-2560x14401-70x70.jpg" class="attachment-post-widget #"  />                </div>
                
                <h6><a href="#">马化腾</a></h6>
                <span>37个回答</span>
                <div class="clear"></div>
                </li> 
                
                 
                </ul>
   <!-- End Widget -->
<div class="clear"></div></div>    <div class="clear"></div>
</div></div>        <!-- End Sidebar -->
    
    <div class="clear"></div>
    </div>
	<!-- End Main Container -->
	
	
    
    

    <!-- Start Footer -->
    <div class="spacing-30"></div>
    <div class="container zerogrid">
        <div id="footer-container" class="col-full">
        <div class="wrap-col">	
            <!-- Footer Copyright -->
            <p>&copy; Copyright &copy; 2014.Company name All rights reserved.<a target="_blank" href="http://www.freemoban.com/">www.freemoban.com</a></p>
            <!-- End Footer Copyright -->
            
            <!-- Footer Logo -->
			<img src="images/footer-logo.png" id="footer-logo" />
            <!-- End Footer Logo -->
        
        <div class="clear"></div>
		</div>
        </div>
    </div>
    <!-- End Footer -->
   
</body>
</html>